class CreateNavigaBars < ActiveRecord::Migration[6.1]
  def change
    create_table :naviga_bars do |t|
      t.string :key
      t.string :name
      t.integer :admin_user_id
      t.datetime :deleted_at
      t.integer :company_id

      t.timestamps
    end
    add_index :naviga_bars, :admin_user_id
    add_index :naviga_bars, :company_id

    create_table :guest_books do |t|
      t.string :phone
      t.string :e_mail
      t.string :name
      t.string :content
      t.integer :admin_user_id
      t.datetime :deleted_at

      t.timestamps
    end
    add_index :guest_books, :admin_user_id

    create_table :teams do |t|
      t.string :name, limit: 200
      t.string :avatar
      t.string :work_job
      t.integer :admin_user_id
      t.datetime :deleted_at
      t.integer :company_id

      t.timestamps
    end
    add_index :teams, :admin_user_id
    add_index :teams, :company_id

    create_table :carousels do |t|
      t.string :name, limit: 200
      t.string :img
      t.string :jump_link
      t.integer :admin_user_id
      t.datetime :deleted_at
      t.integer :company_id

      t.timestamps
    end
    add_index :carousels, :admin_user_id
    add_index :carousels, :company_id

    create_table :company_cases do |t|
      t.string :content
      t.integer :admin_user_id
      t.datetime :deleted_at
      t.integer :company_id

      t.timestamps
    end
    add_index :company_cases, :admin_user_id
    add_index :company_cases, :company_id

    create_table :technical_cores do |t|
      t.string :content
      t.integer :admin_user_id
      t.datetime :deleted_at
      t.integer :company_id

      t.timestamps
    end
    add_index :technical_cores, :admin_user_id
    add_index :technical_cores, :company_id

    add_column :admin_users, :e_mail, :string
    add_column :companies, :address, :string
    add_column :companies, :content, :string
    add_column :companies, :brief, :string
  end
end
